/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package servlet;


import bean.Candidato;
import java.io.IOException;
//import java.io.PrintWriter;
//import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import negocio.NegocioCandidato;


/**
 *
 * @author VENANCIO
 */
public class servletCandidato extends HttpServlet {
      @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
         
        Candidato candidato = new Candidato();
        String cpf =  request.getParameter("cpf");
        
        candidato.setCpf(request.getParameter("cpf"));
        candidato.setNome(request.getParameter("nome"));
        candidato.setSenha(request.getParameter("senha"));
        candidato.setEmail(request.getParameter("email"));        
        
       
        
        NegocioCandidato fachada = NegocioCandidato.getInstance();
        fachada.inserir(candidato);
        request.setAttribute("colecao", fachada.listarCandidato());
        request.getRequestDispatcher("/resultadoCadastrado.jsp").forward(request, response);
        
    
        
 }
      @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
